//
//  PainterTextTuov.m
//  LuGong
//
//  Created by 邱成 on 2017/6/15.
//  Copyright © 2017年 YiShi. All rights reserved.
//

#import "PainterTextTuov.h"

using namespace std;
using namespace ytx;

@implementation PainterTextTuov

- (NSString *) leftSideTextTransform:(double) value withViewModelIndexPosition:(ViewModelIndexPosition *) indexPosition
{
    int round = 1;
    string unit;
    string msg = "";
    if (value >= 10000 && value < 100000000) {
        round = 10000;
        msg = "万";
    } else if (value >= 100000000) {
        round = 100000000;
        msg = "亿" + unit;
    } else if (value < 10000) {
        round = 1;
        msg = unit;
    }
    
    return  [NSString stringWithUTF8String:(Tools::Convert2FixString(value / round) + msg).c_str()];
}

@end
